// author by welong
// zuowl@qq.com
// 2014-09-04  11:10
// PAT basic 1020

#include <stdio.h>
#include <stdlib.h>

#define bool unsigned char 
#define true  1
#define false 0

typedef struct Node
{
	double plenty;	//attention plenty & sale are not integer
	double sale;	//if define unsigned sale, cause test site 3 error
	double key;
}node;

bool comp(node* small, node *big)
{
	if(small->key < big->key)
		return true;
	else
		return false;
}

int main(int argc, char **argv)
{
	unsigned i, j, kind;
	node *array = NULL, temp;
	double total = 0, need;

	scanf("%u%lf", &kind, &need);
	array = (node*)malloc(sizeof(node) * kind);

	for(i = 0; i < kind; i++)
		scanf("%lf", &array[i].plenty);

	for(i = 0; i < kind; i++)
	{
		scanf("%lf", &array[i].sale);
		array[i].key  = array[i].sale/array[i].plenty;
	}

	for(i = 0; i < kind-1; i++)
	{
		for(j = 0; j < kind-1 - i; j++)
		{
			if(comp(array+j, array+j+1))
			{
				temp = array[j];
				array[j] = array[j+1];
				array[j+1] = temp;
			}
		}
	}
//	for(i = 0; i < kind; i++)
//		printf("%d: sale->%lf, key->%lf\n", i, array[i].sale, array[i].key);

	i = 0;
	while(need > 0.000001)
	{
		if(need >= array[i].plenty)
		{
			total += array[i].sale;
			need  -= array[i].plenty;
		}
		else
		{
			total += array[i].key * need;
			need = 0;
		}
		if(++i == kind)
			break;
	}
	printf("%.2lf", total);

	free(array);
	return 0;
}